package com.xbongbong.paas.model.impl;

import com.xbongbong.paas.domain.dao.PaasProcessDataMigrateDao;
import com.xbongbong.paas.model.PaasProcessDataMigrateModel;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.paas.toolbox.util.CollectionsUtil;
import com.xbongbong.pro.domain.entity.PaasProcessDataMigrateEntity;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @author 吴峰
 * @date 2021/11/03 14:04
 */
@Service("paasProcessDataMigrateModel")
public class PaasProcessDataMigrateModelImpl implements PaasProcessDataMigrateModel {

    @Resource
    private PaasProcessDataMigrateDao paasProcessDataMigrateDao;
    
    @Override
    public void insertBatch(List<PaasProcessDataMigrateEntity> list) {
        if (CollectionsUtil.isEmpty(list)) {
            return;
        }
        paasProcessDataMigrateDao.insertBatch(list);
    }

    @Override
    public Integer insert(PaasProcessDataMigrateEntity entity) throws XbbException {
        return paasProcessDataMigrateDao.insert(entity);
    }

    @Override
    public Integer update(PaasProcessDataMigrateEntity entity) throws XbbException {
        return paasProcessDataMigrateDao.update(entity);
    }

    @Override
    public List<PaasProcessDataMigrateEntity> findEntitys(Map<String, Object> entity) {
        return paasProcessDataMigrateDao.findEntitys(entity);
    }

    @Override
    public PaasProcessDataMigrateEntity getByKey(Long key, String corpid) {
        return paasProcessDataMigrateDao.getByKey(key, corpid);
    }

    @Override
    public Integer getEntitysCount(Map<String, Object> entity) {
        return paasProcessDataMigrateDao.getEntitysCount(entity);
    }

    @Override
    public List findEntitysWithoutSub(Map<String, Object> param) {
        return null;
    }

    @Override
    public Integer delete(Long key, String corpid) {
        return paasProcessDataMigrateDao.deleteByKey(key, corpid);
    }
}
